/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL.DAO;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import MODEL.POJO.*;
import java.util.List;
/**
 *
 * @author samph
 */
public class WarehousesDao {
    public static Warehouses LayDeThiTheoMa(int ma){
       Warehouses dethi = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        try {
            dethi = (Warehouses) session.get(Warehouses.class, ma);
        } catch (HibernateException ex) {
            //Log the exception
            System.err.println(ex);
        } finally {
            session.close();
        }
        return dethi; 
    }
}
